package com.xindz.hgq.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.Button;

import com.xindz.hgq.R;
import com.xindz.hgq.base.BaseActivity;
import com.xindz.hgq.base.options.BaseActivityOptions;
import com.xindz.hgq.utils.login.LoginEvent;

import java.io.Serializable;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * @name HGQBase
 * @class name：com.xindz.hgq.activity
 * @describe describe
 * @anthor XINDZ
 * @time 2018/4/25 14:08
 * @change
 * @chang time
 * @class describe
 */
public class LoginActivity extends BaseActivity {
    @BindView(R.id.bt_login_success)
    Button btLoginSuccess;
    @BindView(R.id.bt_login_fail)
    Button btLoginFail;
    private LoginEvent loginEvent;

    @Override
    public BaseActivityOptions setOption() {
        return null;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        ButterKnife.bind(this);
        loginEvent = (LoginEvent) getIntent().getExtras().getSerializable("LoginEvent");
    }

    @OnClick({R.id.bt_login_success, R.id.bt_login_fail})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.bt_login_success:
                if (loginEvent != null) loginEvent.onLoginSuccess();
                break;
            case R.id.bt_login_fail:
                if (loginEvent != null) loginEvent.onLoginFail();
                break;
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}
